package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.OrderSettlementMapper;
import com.ruoyi.business.domain.OrderSettlement;
import com.ruoyi.business.service.IOrderSettlementService;

/**
 * 结算单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-06
 */
@Service
public class OrderSettlementServiceImpl implements IOrderSettlementService 
{
    @Autowired
    private OrderSettlementMapper orderSettlementMapper;

    /**
     * 查询结算单
     * 
     * @param settlementId 结算单主键
     * @return 结算单
     */
    @Override
    public OrderSettlement selectOrderSettlementBySettlementId(Long settlementId)
    {
        return orderSettlementMapper.selectOrderSettlementBySettlementId(settlementId);
    }

    /**
     * 查询结算单列表
     * 
     * @param orderSettlement 结算单
     * @return 结算单
     */
    @Override
    public List<OrderSettlement> selectOrderSettlementList(OrderSettlement orderSettlement)
    {
        return orderSettlementMapper.selectOrderSettlementList(orderSettlement);
    }

    /**
     * 新增结算单
     * 
     * @param orderSettlement 结算单
     * @return 结果
     */
    @Override
    public int insertOrderSettlement(OrderSettlement orderSettlement)
    {
        orderSettlement.setCreateTime(DateUtils.getNowDate());
        return orderSettlementMapper.insertOrderSettlement(orderSettlement);
    }

    /**
     * 修改结算单
     * 
     * @param orderSettlement 结算单
     * @return 结果
     */
    @Override
    public int updateOrderSettlement(OrderSettlement orderSettlement)
    {
        orderSettlement.setUpdateTime(DateUtils.getNowDate());
        return orderSettlementMapper.updateOrderSettlement(orderSettlement);
    }

    /**
     * 批量删除结算单
     * 
     * @param settlementIds 需要删除的结算单主键
     * @return 结果
     */
    @Override
    public int deleteOrderSettlementBySettlementIds(Long[] settlementIds)
    {
        return orderSettlementMapper.deleteOrderSettlementBySettlementIds(settlementIds);
    }

    /**
     * 删除结算单信息
     * 
     * @param settlementId 结算单主键
     * @return 结果
     */
    @Override
    public int deleteOrderSettlementBySettlementId(Long settlementId)
    {
        return orderSettlementMapper.deleteOrderSettlementBySettlementId(settlementId);
    }
}
